{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %}--星之贝</title>
    {% include 'base_css_js.html' %}
    {% block css %}
    {% endblock %}
</head>
<body>
<div class="header_con">
    <div class="header">
        <div class="welcome fl">欢迎使用银川能源学院星之贝二手交易平台!</div>
        <div class="fr">
            {% if request.session.is_login %}
                <div class="login_info fl">
                    欢迎您：<em>{{ request.session.user_name }}({{ request.session.user_sno }})</em>
                </div>
            {% else %}

                <div class="login_btn fl">
                    <a href="{% url 'user:login' %}">登录</a>
                    <span>|</span>
                    <a href="{% url 'user:register' %}">注册</a>
                    <span>|</span>
                    <a href="{% url 'site_config:about_us' %}">关于我们</a>
                    <span>|</span>
                    <a href="/admin/">后台</a>
                </div>
            {% endif %}

            {% if request.session.is_login %}
                <div class="user_link fl">
                    <span>|</span>
                    <a href="{% url 'user:user_center_info' %}">用户中心</a>
                    <span>|</span>
                    <a href="" style="text-decoration:line-through;" onclick="alert('暂未开发完成,敬请期待')">我发布的商品</a>
                    <span>|</span>
                    <a href="{% url 'user:logout' %}">退出账号</a>
                </div>
            {% endif %}
        </div>
    </div>
</div>

<div class="search_bar clearfix">
    <a href="{% url 'goods:index' %}" class="logo fl"><img src="{% static 'images/logo/logo.png' %}" width="150"
                                                           height="59"></a>
    <div class="search_con fl">
        <form method="get" action="{% url 'goods:search' %} ">
            <input type="text" name="keyboard" id="keyboard" class="input_text" value="" placeholder="请输入商品名称">
            <input type="submit" class="input_btn fr" name="" value="搜索">
        </form>
    </div>
    {% if request.session.is_login %}
        <div class="guest_cart fr">
            <a href="{% url 'user:cart' %}" class="cart_name fl">我的收藏</a>
            <div class="goods_count fl" id="show_count">{{ request.session.user_fav_products_num }}</div>
        </div>
    {% endif %}
</div>

{% block body %}

{% endblock %}



{% include 'base_foot.html' %}
<script>
    function is_login() {
        alert('亲，您还没有登录哦。为了更好的用户体验,还请您登陆哦.');
        alert('目前该网站处于测试阶段\n为了更好的服务大家,可加Q群:741359427\n向我们提点意见或建议');
    }
    {% if not request.session.is_login %}
        is_login();
    {% endif %}
</script>

</body>
</html>